package com.caishi.lkx.user.login;

import com.caishi.lkx.common.ienum.DeviceType;
import com.caishi.lkx.user.model.IUserModel;
import com.zzw.common.exception.BizException;


import java.util.Map;

public interface IThirdOauthService {
    Map<String, Object> getAccessToken(String code, DeviceType type);

    Map<String, Object> getUserInfo(String accessToken, String openId, DeviceType pc);

    default Boolean isPc(DeviceType type) {
        switch (type) {
            case admin:
            case pc:
                return true;
            default:
                return false;
        }
    }

    /**
     * 三方登录必须绑定手机号，不需要添加用户
     *
     * @param userInfo
     * @return
     * @throws BizException
     */
    @Deprecated
    IUserModel<?> thirdGenerateUser(Map<String, Object> userInfo);
}
